<style>
    .config-row label{text-align: right;}
    label:not(.form-check-label):not(.custom-file-label) {
        font-weight: normal;
    }
    .J-urlmodel1,.J-urlmodel0 {
        display: none;
    }
    .form-group {
        margin-bottom: .85rem;
    }
</style>
<div class="col-12 col-sm-12">
        <div class="card card-primary card-tabs">
            <div class="card-header">
                <ul class="nav nav-tabs" id="custom-tabs-three-tab" role="tablist">
                    <li class="nav-item">
                        <a class="nav-link active" id="group-tab" data-toggle="pill" data-page="group" href="#pane-group-tab" role="tab" aria-selected="false">{:lang('URL Config')}</a>
                    </li>
                </ul>
            </div>
            <div class="card-body config-row">
                <div class="tab-content" id="custom-tabs-three-tabContent">
                    <div class="tab-pane fade active show" id="pane-group-tab" role="tabpanel">
                        <form role="form" action="{:url('/routine.seo/index')}" class="frm-operate" method="post">
                            <div class="form-group row mb-4">
                                <label class="col-sm-2 col-form-label">{:lang("URL mode")}: </label>
                                <div class="col-sm-8">
                                    <div class="radio-group">
                                        <input id="row[url_mode]-2" name="row[url_mode]" type="radio" value="0" {if $field['url_mode']==0}checked="checked"{/if}>
                                        <label for="row[url_mode]-2">动态</label>&nbsp;
                                        <input id="row[url_mode]-1" name="row[url_mode]" type="radio" value="1" {if $field['url_mode']==1}checked="checked"{/if}>
                                        <label for="row[url_mode]-1">伪静态</label>&nbsp;
                                    </div>
                                    <div class="text-muted text-xs">注意：勾选伪静态后您的服务器必须配置URL重写才能正常访问</div>
                                </div>
                            </div>
                            <div class="J-urlmodel1">
                                <div class="form-group row">
                                    <label class="col-sm-2 col-form-label">{:lang("URL format")}: </label>
                                    <div class="col-sm-8" style="padding-top: calc(0.375rem + 1px);">
                                        <div class="">
                                            <input id="row[url_format]-2" name="row[url_format]" type="radio" value="1" {if $field['url_rewrite']==1}checked="checked"{/if}>
                                            <label for="row[url_format]-2">当前目录</label>
                                        </div>
                                        <div class="">
                                            <input id="row[url_format]-6" name="row[url_format]" type="radio" value="2" {if $field['url_rewrite']==2}checked="checked"{/if}>
                                            <label for="row[url_format]-6">多语言/当前目录</label>
                                        </div>
                                        <div class="">
                                            <input id="row[url_format]-1" name="row[url_format]" type="radio" value="3" {if $field['url_rewrite']==3}checked="checked"{/if}>
                                            <label for="row[url_format]-1">父目录/当前目录</label>
                                        </div>
                                        <div class="">
                                            <input id="row[url_format]-3" name="row[url_format]" type="radio" value="4" {if $field['url_rewrite']==4}checked="checked"{/if}>
                                            <label for="row[url_format]-3">多语言/父目录/当前目录</label>
                                        </div>
                                        <div class="">
                                            <input id="row[url_format]-4" name="row[url_format]" type="radio" value="5" {if $field['url_rewrite']==5}checked="checked"{/if}>
                                            <label for="row[url_format]-4">模型/栏目</label>
                                        </div>
                                        <div class="">
                                            <input id="row[url_format]-0" name="row[url_format]" type="radio" value="0" {if !in_array($field['url_rewrite'],[1,2,3,4,5])}checked="checked"{/if}>
                                            <label for="row[url_format]-0" class="mb-0">自定义, <a href="{:url('/routine.config/index',['tabs_page'=>'more'])}" class="text-primary btn-newMenu" data-id="{:url('/routine.config/index')}" data-title="{:lang('Site config')}">点我前往</a></label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">{:lang("Column title format")}: </label>
                                <div class="col-sm-8" style="padding-top: calc(0.375rem + 1px);padding-bottom: calc(0.375rem + 1px);">
                                    <div class="">
                                        <input id="row[category_format]-2" name="row[category_format]" type="radio" value="$name - $site" {if $field['category_format']=='$name - $site'}checked="checked"{/if}>
                                        <label for="row[category_format]-2">栏目名称 - 网站名称</label>
                                    </div>
                                    <div class="">
                                        <input id="row[category_format]-1" name="row[category_format]" type="radio" value="$name - 第$page页 - $site" {if $field['category_format']=='$name - 第$page页 - $site'}checked="checked"{/if}>
                                        <label for="row[category_format]-1">栏目名称 - 第N页 - 网站名称</label>
                                    </div>
                                    <div class="">
                                        <input id="row[category_format]-3" name="row[category_format]" type="radio" value="$name_第$page页" {if $field['category_format']=='$name_第$page页'}checked="$name_第$page页"{/if}>
                                        <label for="row[category_format]-3">栏目名称_第N页</label>
                                    </div>
                                    <div class="">
                                        <input id="row[category_format]-4" name="row[category_format]" type="radio" value="$name_第$page页_$site" {if $field['category_format']=='$name_第$page页_$site'}checked="checked"{/if}>
                                        <label for="row[category_format]-4">栏目名称_第N页_网站名称</label>
                                    </div>
                                    <div class="d-flex align-items-center" style="flex: 0 0 100%;">
                                        <input id="row[category_format]-5" name="row[category_format]" type="radio" value="-1" {if !in_array($field['category_format'],['$name_第$page页_$site','$name - $site','$name - 第$page页 - $site','$name_第$page页','$name_第$page页_$site'])}checked="checked"{/if}>
                                        <label for="row[category_format]-5" class="mb-0" style="display: flex;align-items: center;flex: 0 0 100%;"><span class="ml-1">自定义：</span><input type="text" placeholder="示例：$name - 第$page页 - $site" class="form-control" style="width: 50%" name="row[category_format_diy]" value="{if !in_array($field['category_format'],['$name_第$page页_$site','$name - $site','$name - 第$page页 - $site','$name_第$page页','$name_第$page页_$site'])}{$field['category_format']}{/if}"></label>
                                    </div>
                                    <div class="text-muted text-xs mt-1">栏目名称：$name；网站名称：$site；页码：$page</div>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">{:lang("Content title format")}: </label>
                                <div class="col-sm-8" style="padding-top: calc(0.375rem + 1px);padding-bottom: calc(0.375rem + 1px);">
                                    <div class="">
                                        <input id="row[content_format]-2" name="row[content_format]" type="radio" value="$title" {if $field['content_format']=='$title'}checked="checked"{/if}>
                                        <label for="row[content_format]-2">内容标题</label>
                                    </div>
                                    <div class="">
                                        <input id="row[content_format]-5" name="row[content_format]" type="radio" value="$title - $site" {if $field['content_format']=='$title - $site'}checked="checked"{/if}>
                                        <label for="row[content_format]-5">内容标题 - 网站名称</label>
                                    </div>
                                    <div class="">
                                        <input id="row[content_format]-1" name="row[content_format]" type="radio" value="$title - $name - $site" {if $field['content_format']=='$title - $name - $site'}checked="checked"{/if}>
                                        <label for="row[content_format]-1">内容标题 - 栏目名称 - 网站名称</label>
                                    </div>
                                    <div class="">
                                        <input id="row[content_format]-3" name="row[content_format]" type="radio" value="$title_$site" {if $field['content_format']=='$title_$site'}checked="checked"{/if}>
                                        <label for="row[content_format]-3">内容标题_网站名称</label>
                                    </div>
                                    <div class="">
                                        <input id="row[content_format]-4" name="row[content_format]" type="radio" value="$title_$name_$site" {if $field['content_format']=='$title_$name_$site'}checked="checked"{/if}>
                                        <label for="row[content_format]-4">内容标题_栏目名称_网站名称</label>
                                    </div>
                                    <div class="d-flex align-items-center" style="flex: 0 0 100%;">
                                        <input id="row[content_format]-6" name="row[content_format]" type="radio" value="-1" {if !in_array($field['content_format'],['$title','$title - $site','$title - $name - $site','$title_$site','$title_$name_$site'])}checked="checked"{/if}>
                                        <label for="row[content_format]-6" class="mb-0" style="display: flex;align-items: center;flex: 0 0 100%;"><span class="ml-1">自定义：</span><input type="text" placeholder="示例：$name - 第$page页 - $site" class="form-control" style="width: 50%" name="row[content_format_diy]" value="{if !in_array($field['content_format'],['$title','$title - $site','$title - $name - $site','$title_$site','$title_$name_$site'])}{$field['content_format']}{/if}"></label>
                                    </div>
                                    <div class="text-muted text-xs mt-1">栏目名称：$name；网站名称：$site；内容标题：$title</div>
                                </div>
                            </div>
                            <div class="J-urlmodel0">
                                <div class="form-group row">
                                    <label class="col-sm-2 col-12 col-form-label">前台入口文件：</label>
                                    <div class="col-sm-6 col-12">
                                        <div class="radio-group">
                                            <input id="row[url_file]-1" name="row[url_file]" type="radio" value="1" {if $field['url_file']==1}checked="checked"{/if}>
                                            <label for="row[url_file]-1">显示(index.php)</label>&nbsp;
                                            <input id="row[url_file]-2" name="row[url_file]" type="radio" value="0" {if $field['url_file']==0}checked="checked"{/if}>
                                            <label for="row[url_file]-2">隐藏(index.php)</label>&nbsp;
                                        </div>
                                        <div class="text-muted text-xs">注意：勾选隐藏后您的服务器必须配置URL重写才能正常访问</div>
                                    </div>
                                    <div class="col-sm-2"><a href="https://www.kancloud.cn/hkcms/hkcms_tp6/2252604" class="text-primary" target="_blank">{:lang('Help')}</a></div>
                                </div>
                            </div>
                            <div class="row justify-content-around mt-5">
                                <div class="col-sm-8">
                                    <button type="submit" class="btn btn-primary btn-submit">{:lang('Submit')}</button>
                                    <button type="reset" class="btn btn-default">{:lang('Reset')}</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
</div>

{block:script}
<script>
    require(['jquery','adminlte','Form','layer'], function ($, undefined, Form, undefined) {
        Form.api.init({
            success: function () {
                layer.msg(lang('Successful operation'), {time:2000, icon:1}, function () {
                    window.location.href = "{:url('/routine.seo/index')}";
                });
                return false;
            }
        });

        $('input[name="row[url_mode]"]').change(function (e) {
            if ($(this).val()==0) {
                $('.J-urlmodel1').hide();
                $('.J-urlmodel0').show();
            } else {
                $('.J-urlmodel0').hide();
                $('.J-urlmodel1').show();
            }
        });
        $('input[name="row[url_mode]"]:checked').trigger('change');
    });
</script>
{/block:script}